package com.example.design.bridge.abst;

import com.example.design.bridge.function.RegisterLoginFuncInterface;
import com.example.design.pojo.UserInfo;

import javax.servlet.http.HttpServletRequest;
//桥接模式抽象角色子类
public class RegisterLoginComponent extends AbstractRegisterLoginComponent{
    //通过构造函数传入RegisterLoginFuncInterface具体实现类
    public RegisterLoginComponent(RegisterLoginFuncInterface registerLoginFuncInterface) {
        super(registerLoginFuncInterface);
    }

    @Override
    public String login(String account, String password) {
        return registerLoginFuncInterface.login(account, password);
    }

    @Override
    public String register(UserInfo userInfo) {
        return registerLoginFuncInterface.register(userInfo);
    }

    @Override
    public boolean checkUserExists(String userName) {
        return registerLoginFuncInterface.checkUserExists(userName);
    }

    @Override
    public String login3rd(HttpServletRequest request) {
        return registerLoginFuncInterface.login3rd(request);
    }
}
